import 'package:flutter/material.dart';

class global extends ChangeNotifier {
  //尽管通过get 方法后面，这个赋值没有意义。但是也要赋值。不能用late，否则会发生一些问题
  ColorScheme _colorScheme = ColorScheme.fromSeed(seedColor: Colors.deepPurple);
  String _locale = "zh_CN";


  var _colorList = [Colors.deepOrange, Colors.deepPurple, Colors.teal];

  List _numList = [1,3,4,5,7,4];
  //获取数据
  List get numList => _numList;
  List get colorList => _colorList;

  ColorScheme get colorScheme => _colorScheme;
  String get locale => _locale;




  void changeColorScheme(MaterialColor e) {
    if(e == Colors.teal){
      _colorScheme = ColorScheme.fromSeed(seedColor: Colors.teal);
    }
    if(e == Colors.deepOrange){
      _colorScheme = ColorScheme.fromSeed(seedColor: Colors.deepOrange);
    }
    if(e == Colors.deepPurple){
      _colorScheme = ColorScheme.fromSeed(seedColor: Colors.deepPurple);
    }
    notifyListeners(); //通知更新数据
  }

  void changeLanguage(value) {
    _locale = value;
    notifyListeners(); //通知更新数据

  }



// getUserImg() async{
//   return false;
// }

}
